

package controller;




import bo.BUS_ChiTietHoaDon;
import bo.BUS_HoaDon;
import com.opensymphony.xwork2.ActionSupport;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;




public class XoaHDAction extends ActionSupport implements ServletRequestAware {

    private HttpServletRequest request;

    public XoaHDAction() {

    }



    public String execute() throws Exception {

        int MaHD = Integer.parseInt(request.getParameter("GiaTriTim"));
        BUS_ChiTietHoaDon buscthd = new BUS_ChiTietHoaDon();
        boolean flag_cthd = buscthd.XoaCTHD(MaHD);
        BUS_HoaDon bushd = new BUS_HoaDon();
        boolean flag_hd = bushd.XoaHD(MaHD);
        if(flag_cthd == true && flag_hd == true)
        {
            return "success";
        }
        return "fail";

    }

    @Override
    public void setServletRequest(HttpServletRequest hsr) {
        request = hsr;
    }



}